package org.csc.api;

import org.csc.api.filter.AccessFilter;
import org.csc.api.filter.ErrorFilter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;

@EnableDiscoveryClient
@SpringBootApplication
@EnableZuulProxy
public class ApiAppplication {
    private static final Logger log = LoggerFactory.getLogger(ApiAppplication.class);

    public static void main(String[] args) {
        SpringApplication.run(ApiAppplication.class, args);
        log.info("【api项目启动成功......】");
    }

    @Bean
    public AccessFilter accessFilter() {
        return new AccessFilter();
    }

    @Bean
    public ErrorFilter errorFilter() {
        return new ErrorFilter();
    }

}
